package com.xiu.travel.expression;

import com.xiu.travel.util.SecurityUtils;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * miaomiaomiao
 *
 * @author yingyingying
 * @date 2023/3/13 20:45
 */
@Component("qianlSg")
public class SGERoot
{
    public boolean hasAuthority(String authority)
    {
        List<String> permissions = SecurityUtils.getPermissions();
        return permissions.contains(authority);
    }

    public boolean hasRole(String authority)
    {
        List<String> perm = SecurityUtils.getRole();
        return perm.contains(authority);
    }
}
